package com.jjsc.client.api;

import com.jjsc.client.api.domain.UpdateUserLogin;
import com.jjsc.client.api.domain.UserInfo;
import com.jjsc.client.api.factory.RemoteUserInfoFallbackFactory;
import com.jjsc.common.core.constant.SecurityConstants;
import com.jjsc.common.core.constant.ServiceNameConstants;
import com.jjsc.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 钟城明
 * @CreateTime: 2025-10-16
 * @Description:
 * @Version: 1.0
 */
@FeignClient(
        contextId = "RemoteUserInfoService",
        value = ServiceNameConstants.CLIENT_SERVICE,
        fallbackFactory = RemoteUserInfoFallbackFactory.class
)
public interface RemoteUserInfoService {

    @PostMapping("userInfo/register")
    R<Boolean> register(@RequestBody UserInfo userInfo,
                               @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("userInfo/info/{username}")
    R<UserInfo> getUserInfo(@PathVariable("username") String username,
                                   @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @PutMapping("userInfo/updateUserLogin")
    R<Boolean> updateUserLogin(@RequestBody UpdateUserLogin updateUserLogin,
                               @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
